#pragma once

#include "Service.h"
#include "Hikari.h"

class UISprite;
class UIService : public Service
{
	class UITask;

public:	
							UIService();
	virtual					~UIService();

	void					Load();
	void					ChangeVisible();

	void					UpdateSprite();

protected:
	virtual void			OnReset();
	void					MouseUpdated(InputMouseEvent* evt);

private:
	UITask*					m_UITask;

	Hikari::HikariManager*	m_HikariManager;
	
	UISprite*				m_Sprite;
};

class UISprite
{
public:
							UISprite( Hikari::HikariManager* hikarimgr, const char* name, const char* path,
										uint width, uint height, Hikari::Position p = Hikari::Center);
	virtual					~UISprite();

	virtual void			Update(float dt);
	void					ChangeVisible();
	
	// Test
	Hikari::FlashValue		onOpacityChange(Hikari::FlashControl* caller, const Hikari::Arguments& args);
	Hikari::FlashValue		onColorChange(Hikari::FlashControl* caller, const Hikari::Arguments& args);

private:
	Hikari::FlashControl*	m_Sprite;
	bool					m_IsShow;
};